package com.geekmvc.controller;


import com.geekmvc.entity.Coffee;
import com.geekmvc.service.CoffeeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/coffee/json")
public class CoffeeJsonController {
    @Resource
    private CoffeeService coffeeService;

    @GetMapping(path = "/", params = "!name")
    @ResponseBody
    public List<Coffee> getAll() {
        return coffeeService.getAllCoffee();
    }

}
